<?php
if (!defined('W_ROOT')) {
	exit();
}

	$erro = (isset($_GET['error']))?$_GET['error']:'';
	switch($erro){
		case'invalid_file':
			$error_msg = '<div class="warning">'.$lang['MSG_INVALID_FILE'].'</div>';
		break;
		case'invalid_url':
			$error_msg = '<div class="warning">'.$lang['MSG_INVALID_URL'].'</div>';
		break;
		case 'already_exist':
			$error_msg = '<div class="warning">File already exist,Please choose a new one</div>';
		break;
		case 'invalidurl':
			$error_msg = '<div class="warning">Invalid Link URL format!</div>';
			break;
	}

?>
<div class="breadcrumb">
	<a href="<?php echo base_url_admin;?>"><?php echo $lang['HOME'];?></a>
		::<a href="index.php?view=list"><?php echo $lang['BAN_MANAG']; ?></a>
		::<?php echo $lang['INSERT']; ?>
	</div>
<div class="box">
<?php echo @$error_msg ?>
<div class="heading">
	<h1><img src="../templates/image/banner.png" alt="" />
		<?php echo $lang['BAN_MANAG']; ?>&nbsp;&nbsp;&nbsp;<span class="required">(*) all asterisks must be required!</span>
	</h1>
	<div class="buttons">
	<form action="<?php echo base_url_admin;?>/banner/process.php?action=add"  method="post" name="frmlist" onSubmit="return validateBanner()" enctype="multipart/form-data">

		<input class="button" type="submit" name="btnsave" value="<?php echo $lang['SAVE']; ?>"/>&nbsp;&nbsp;&nbsp;
				<input class="button" type="reset" name="btnreset" value="<?php echo $lang['RESET']; ?>" />&nbsp;&nbsp;&nbsp;
				<input class="button" type="button" name="btncancel" value="<?php echo $lang['CANCEL']; ?>" onClick="javascript:window.history.back();" />
	</div>
	</div>
	<div class="content">
<div class="row">
		<table cellpadding="5" cellspacing="5" border="0" width="100%" align="center">
		<tr>
			<td width="10%" height="30" align="left" valign="top"><?php echo $lang['BAN_TITLE']; ?><strong style="color:#F00;">*</strong></td>
			<td width="5%" align="left" valign="top">:</td>
			<td width="80%" align="left">
					<input name="txttitle" type="text"  alt="required" id="txttitle"  value="<?php echo @$_SESSION['title']?@$_SESSION['title']:'';?>" required />
			</td>
		</tr>
		<tr>
			<td width="10%" height="30" align="left" valign="top"><?php echo $lang['UP_IMG'] ; ?> <strong style="color:#F00;">*</strong></td>
			<td width="5%" align="left" valign="top">:</td>
			<td width="80%" align="left">
					<input name="txtimage" type="file"  value="<?php echo @$_SESSION['link']?@$_SESSION['link']:'';?>" required />
			</td>
		</tr>
		<tr>
			<td width="10%" height="30" align="left" valign="top"><?php echo $lang['ADD_LINK_IMG'];?><span style="color:#F00;"> <code>*</code></span></td>
			<td width="5%" align="left" valign="top">:</td>
			<td width="80%" align="left">
					<input name="txtaddlink" type="text"  id="txtmeta_desc"  value="<?php echo @$_SESSION['link']?@$_SESSION['link']:'';?>" required /> <span style="color:#F00;"><?php echo $lang['NOTE_GOOGLE']; ?></span>
			</td>
		</tr>

		<tr>
			<td width="10%" height="30" align="left" valign="top"><?php echo $lang['DISCRIPTION']; ?></td>
			<td width="5%" align="left" valign="top">:</td>
			<td width="80%" align="left">
			<textarea name="txtdescription" style="width:50%;height:100px;"><?php echo @$_SESSION['desc']?@$_SESSION['desc']:'';?></textarea>
			</td>
		</tr>

		<tr>
		<td>&nbsp;</td>
		</tr>
	</table>

</form>

</div><!--<div class="row">-->
</div>
</div>